package com.hczt.xhminiapp.common.redis;

import com.hczt.xhminiapp.common.bean.Constants;
import lombok.AllArgsConstructor;

@AllArgsConstructor
public class BasePrefix implements KeyPrefix {
	private int expire;
	private String prefix;
	
	public BasePrefix(String prefix) {
		this(0, prefix);
	}
	
	@Override
	public int expire() {
		return this.expire;
	}

	@Override
	public String getPrefix() {
		String className = getClass().getSimpleName();
		return String.join(":", Constants.PROJECT_NAME, className, prefix);
	}

}